<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateEmployeesTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{employeesController.selected.firstName}" title="#{bundle.CreateEmployeesTitle_firstName}" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{employeesController.selected.lastName}" title="#{bundle.CreateEmployeesTitle_lastName}" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_password}" for="password" />
                    <h:inputSecret id="password" value="#{employeesController.selected.password}" title="#{bundle.CreateEmployeesTitle_password}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_password}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_personalEmail}" for="personalEmail" />
                    <h:inputText id="personalEmail" value="#{employeesController.selected.personalEmail}" title="#{bundle.CreateEmployeesTitle_personalEmail}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_personalEmail}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_businessEmail}" for="businessEmail" />
                    <h:inputText id="businessEmail" value="#{employeesController.selected.businessEmail}" title="#{bundle.CreateEmployeesTitle_businessEmail}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_businessEmail}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_address}" for="address" />
                    <h:inputText id="address" value="#{employeesController.selected.address}" title="#{bundle.CreateEmployeesTitle_address}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_address}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_birthDate}" for="birthDate" />
                    <p:calendar value="#{employeesController.selected.birthDate}" id="birthDate" showOn="button" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_nationality}" for="nationality" />
                    <h:inputText id="nationality" value="#{employeesController.selected.nationality}" title="#{bundle.CreateEmployeesTitle_nationality}" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_maritalStatus}" for="maritalStatus" />
                    <h:selectOneRadio id="maritalStatus" value="#{employeesController.selected.maritalStatus}" title="#{bundle.CreateEmployeesTitle_maritalStatus}">
                        <f:selectItem itemValue="Single" itemLabel="Single" />
                        <f:selectItem itemValue="Married" itemLabel="Married" />
                    </h:selectOneRadio>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_gender}" for="gender" />
                    <h:selectOneRadio id="gender" value="#{employeesController.selected.gender}" title="#{bundle.CreateEmployeesTitle_gender}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_gender}">
                        <f:selectItem itemValue="Male" itemLabel="Male" />
                        <f:selectItem itemValue="Female" itemLabel="Female" />
                    </h:selectOneRadio>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_skype}" for="skype" />
                    <h:inputText id="skype" value="#{employeesController.selected.skype}" title="#{bundle.CreateEmployeesTitle_skype}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_skype}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_phoneNumber}" for="phoneNumber" />
                    <h:inputText id="phoneNumber" value="#{employeesController.selected.phoneNumber}" title="#{bundle.CreateEmployeesTitle_phoneNumber}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_phoneNumber}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_mobile1}" for="mobile1" />
                    <h:inputText id="mobile1" value="#{employeesController.selected.mobile1}" title="#{bundle.CreateEmployeesTitle_mobile1}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_mobile1}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_mobile2}" for="mobile2" />
                    <h:inputText id="mobile2" value="#{employeesController.selected.mobile2}" title="#{bundle.CreateEmployeesTitle_mobile2}" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_salary}" for="salary" />
                    <h:inputText id="salary" value="#{employeesController.selected.salary}" title="#{bundle.CreateEmployeesTitle_salary}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_salary}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_startDate}" for="startDate" />
                    <p:calendar value="#{employeesController.selected.startDate}" id="startDate" showOn="button" />
                    
                    <h:outputLabel value="#{bundle.ListEmployeesTitle_allHolidays}" for="allHolidays" />
                    <h:inputText id="allHolidays" value="#{employeesController.selected.allHolidays}" title="#{bundle.ListEmployeesTitle_allHolidays}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_allHolidays}"/>

                    <h:outputLabel value="#{bundle.ListEmployeesTitle_usedHolidays}" for="usedHolidays" />
                    <h:inputText id="usedHolidays" value="#{employeesController.selected.usedHolidays}" title="#{bundle.ListEmployeesTitle_usedHolidays}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_status}" for="status" />
                    <h:inputText id="status" value="#{employeesController.selected.status}" title="#{bundle.CreateEmployeesTitle_status}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_status}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_type}" for="type" />
                    <h:inputText id="type" value="#{employeesController.selected.type}" title="#{bundle.CreateEmployeesTitle_type}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_type}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_jobTitle1}" for="jobTitle1" />
                    <h:selectOneMenu id="jobTitle1" value="#{employeesController.selected.jobTitle1}" title="#{bundle.CreateEmployeesTitle_jobTitle1}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_jobTitle1}">
                        <f:selectItems value="#{jobsTitlesController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_jobTitle2}" for="jobTitle2" />
                    <h:selectOneMenu id="jobTitle2" value="#{employeesController.selected.jobTitle2}" title="#{bundle.CreateEmployeesTitle_jobTitle2}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_jobTitle2}">
                        <f:selectItems value="#{jobsTitlesController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_currency}" for="currency" />
                    <h:selectOneMenu id="currency" value="#{employeesController.selected.currency}" title="#{bundle.CreateEmployeesTitle_currency}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_currency}">
                        <f:selectItems value="#{currenciesController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    
                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_kinName}" for="kinName" />
                    <h:inputText id="kinName" value="#{employeesController.selected.kinName}" title="#{bundle.CreateEmployeesTitle_kinName}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_kinName}"/>

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_kinRelationship}" for="kinRelationship" />
                    <h:inputText id="kinRelationship" value="#{employeesController.selected.kinRelationship}" title="#{bundle.CreateEmployeesTitle_kinRelationship}" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_kinPhoneNumber}" for="kinPhoneNumber" />
                    <h:inputText id="kinPhoneNumber" value="#{employeesController.selected.kinPhoneNumber}" title="#{bundle.CreateEmployeesTitle_kinPhoneNumber}" />

                    <h:outputLabel value="#{bundle.CreateEmployeesLabel_kinEmail}" for="kinEmail" />
                    <h:inputText id="kinEmail" value="#{employeesController.selected.kinEmail}" title="#{bundle.CreateEmployeesTitle_kinEmail}" required="true" requiredMessage="#{bundle.CreateEmployeesRequiredMessage_kinEmail}"/>

                </h:panelGrid>
                <br />
                <h:commandButton action="#{employeesController.create}" type="submit" value="#{bundle.CreateEmployeesSaveLink}" />
            </h:form>
            <h:form>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <h:commandButton action="#{employeesController.prepareList}" value="#{bundle.CreateEmployeesShowAllLink}"/>
                <h:button value="#{bundle.CreateEmployeesIndexLink}" outcome="/index"/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
